This is a simple CDEF which will generate a simple progress box. It's very useful as a visual representation of the progress of an operation. (i.e. A file transfer, a file copy, etc)
The progress box has a one pixel outline, and is filled from left to right.
A progress control can be any size, but unless it's more than 2 pixels by 2 pixels, it won't help you much.
The control displays progress in relation to the contrlMax and contrlValue fields of the ControlRecord which are changable with the SetCtlValue and SetCtlMax routines.
The contrlMin field is used to specify the color the progress part of the progress control is displayed in. This field needs to be set to an old-style Quickdraw color constant.
The contrlValue and contrlMax fields of the ControlRecord are short words (integers). You may need long words (longints). In which case, the RefCon of the control will be set automatically by the CDEF to the following handle:
ProgressHand = ^ProgressPtr;
ProgressPtr = ^ProgressRec;
ProgressRec = record
SoFar: longint;
Total: longint;
end;
This handle will be automatically disposed of when the control is disposed.